package com.tesis_2.Utils;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.example.t2_clientback.R;
import com.tesis_2.MO.MORestaurant;

public class UTSeleccionar_Rest_Local_Adapter extends  ArrayAdapter<MORestaurant> {
	
	private final Context context;
	private final ArrayList<MORestaurant> values;
	
	public UTSeleccionar_Rest_Local_Adapter(Context context,ArrayList<MORestaurant> objects)
	{
		super(context, R.layout.activity_uiseleccionar_rest_local, objects);
		this.context = context;
		this.values = objects;
	}
	
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = (LayoutInflater) context
			.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
		View rowView = inflater.inflate(R.layout.activity_uiseleccionar_rest_local, parent, false);
		((TextView) rowView.findViewById(R.id.txvRestaurant_seleccionar_rest_local)).setText( ((MORestaurant) getItem(position)).getName());
		((TextView) rowView.findViewById(R.id.txvDescripcion_seleccionar_rest_local)).setText( ""); //((MORestaurant) getItem(position)).getDescr()
		return rowView;
	}

}
